set BASEDIR=%CD%\..
set LIB_PATH=%BASEDIR%\lib
set SRV=%BASEDIR%\tools\prunsrvamd64.exe
if "%JVM%" == "" goto findJvm
if exist "%JVM%" goto foundJvm
:findJvm
set "JVM=C:\Program Files\Java\jre6\bin\server\jvm.dll"
if exist "%JVM%" goto foundJvm
set "JVM=C:\Program Files\Java\jre6\bin\client\jvm.dll"
if exist "%JVM%" goto foundJvm
echo can not find jvm.dll automatically,
echo please use COMMAND to localation it 
echo for example : set "JVM=C:\Program Files\Java\jre6\bin\server\jvm.dll"
echo then install service
goto end
:foundJvm
%BASEDIR%\tools\prunsrv.exe //%1//ATestService --DisplayName="Test Service" 	--Classpath=.\bin;.\lib\log4j-1.2.14.jar  --Install=%BASEDIR%\tools\prunsrv.exe --Jvm=auto --Startup=auto --StartMode=jvm --StopMode=jvm --StartPath=%BASEDIR% --StartClass=daemon.DeamonService --StartMethod=windowsService --StartParams=start --StopPath=%BASEDIR% --StopClass=daemon.DeamonService --StopMethod=windowsService --StopParams=stop --LogPath=%BASEDIR%\log --StdOutput=auto --StdError=auto

:end
